<?php 
	 $session = new Zend_Session_Namespace('cart');
?>
<header>
	<div id="logo">
		<a href="index-2.html"><img src="images/logo.png" alt="Oceanic Store"></a>
	</div>
	<form id='timkiemsp' action="<?php echo $this->baseUrl().'/sanpham/timkiem'?>" method="post">
	    <span id="search"> <input type="text" name="kw" placeholder='Từ khóa tìm kiếm'> 
	    <span class="button-search"></span>
	    </span>
	</form> <br> 
	<?php 
	    $customer = new Zend_Session_Namespace('customers');
	    $user = $customer->u;
	    if(is_null($user)):
	?>
	<span id="welcome">Welcome visitor you can <a
		href="login.html">login</a> or <a href="login.html">create an account</a>.
	</span>
	<?php 
	    else :
	?>
	<span id="welcome">Xin chào <?php echo "<a href='#'>{$user->data()->name}</a>";?> 
	</span>
	<?php 
	    endif;
	?>
	
	
	<div id="cart" class="item">
		<div class="cart-total">
			<span class="icon show-phone hide-desktop hide-tablet"></span>
			
			<div id='coin'> $<?php echo isset($session->total) ? $session->total : 0 ; ?> </div>
			<div class="drop-arrow"></div>
		</div>
		<div class="cart-wrap">
			<div class="cart-text">Shopping Cart</div>
			<div class="cart-count">
			<?php 
			    if(isset($session->cart) and is_array($session->cart)){
			    	echo array_sum($session->cart)." item(s)";
			    }else{
			    	echo "0 item(s)";
			    }
			?>
			 </div>
			 
		</div>
		<div class="drop-content">
			
		</div>
	</div>
</header>